﻿using System;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Reflection;

namespace Data
{
    public class MediaForecaststatistics
    {
        /// <summary>
        /// 主键
        /// </summary>
        private readonly string primaryKey = "id";
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long Add(Model.MediaForecaststatistics model)
        {
            return new DataAccess().Add<Model.MediaForecaststatistics>(model, primaryKey);
        }

       
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(Model.MediaForecaststatistics model)
        {
            return new DataAccess().Update<Model.MediaForecaststatistics>(model, primaryKey);
        }

        public Model.MediaForecaststatistics GetModelBysql(string sql)
        {
            return new DataAccess().Get<Model.MediaForecaststatistics>(sql);
        }
       
        public List<Model.MediaForecaststatistics> GetList(string Sql)
        {
            return new DataAccess().GetList<Model.MediaForecaststatistics>(Sql);
        }

        public DataTable GetPageListBysql(string sql)
        {
            return DbHelp.ExecuteDataset(DBConfig.ConnectionSettings, CommandType.Text, sql, null).Tables[0];
        }

        public int Insert(string sql)
        {
            return DbHelp.ExecuteNonQuery(DBConfig.ConnectionSettings, CommandType.Text, sql, null);
        }
    }
}
